import request from '../../utils/request';

// 用户组管理相关 API

// 更新用户组
export const updateUserGroup = (data: any) => {
    return request({
        url: '/system/api/user-group/update',
        method: 'put',
        data
    });
};

// 保存用户组
export const saveUserGroup = (data: any) => {
    return request({
        url: '/system/api/user-group/save',
        method: 'post',
        data
    });
};

// 根据ID获取用户组
export const getUserGroupById = (id: string) => {
    return request({
        url: `/system/api/user-group/${id}`,
        method: 'get'
    });
};

// 分页查询用户组
export const getUserGroupPage = (params: any) => {
    return request({
        url: '/system/api/user-group/page',
        method: 'get',
        params
    });
};

// 获取用户组列表
export const getUserGroupList = () => {
    return request({
        url: '/system/api/user-group/list',
        method: 'get'
    });
};

// 获取启用的用户组
export const getEnabledUserGroups = () => {
    return request({
        url: '/system/api/user-group/enabled',
        method: 'get'
    });
};

// 删除用户组
export const deleteUserGroup = (id: string) => {
    return request({
        url: `/system/api/user-group/${id}`,
        method: 'delete'
    });
};
